<?php
// +----------------------------------------------------------------------
// | Yzncms [ 御宅男工作室 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2018 http://yzncms.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 御宅男 <530765310@qq.com>
// +----------------------------------------------------------------------

// +----------------------------------------------------------------------
// | 登录验证
// +----------------------------------------------------------------------
namespace app\api\validate;

use think\Validate;

class Admin extends Validate
{

    //定义验证规则
    protected $rule = [
        'phone' => 'require|mobile',
        'realname' => 'require',
        'team_name' => 'require',
        'code' => 'require',
        'password'  => 'require|length:3,20|confirm',
    ];

    protected $message = [
        'phone.require' => '手机号不能为空',
        'realname.require' => '真实姓名不能为空',
        'team_name.require' => '团队名称不能为空',
        'code.require' => '验证码不能为空',
        'phone.mobile' => '请输入正确的手机号',
        'password.require' => '密码不能为空',
        'password.length' => '密码长度为3-20',
        'password.confirm' => '两次密码不一致',
    ];


    //定义验证场景
    protected $scene = [
        'insert' => ['phone','realname','team_name','code','password'],

    ];

}
